package com.zj.leetcode.medium;

import java.util.HashMap;
import java.util.Stack;

/**
 * @program: algorithm
 * @description:
 * 分割等和子集
 * 416 partition-equal-subset-sum
 * @author: Zhang Bo
 * @create: 2022-04-14 17:29:28
 **/
public class PartitionEqualSubsetSum{
    public static void main(String[] args) {
        Solution solution = new PartitionEqualSubsetSum().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public boolean canPartition(int[] nums) {

            int sum = 0;
            /**
             * HashMap<Integer, Integer>;
             * key: num;
             * value: count;
             */
            HashMap<Integer, Integer> map = new HashMap<>();
            for (int num : nums) {
                sum +=num;
                map.put(num, map.getOrDefault(num, 0) + 1);
            }

            if(sum % 2 != 0){
                return false;
            }

            int sub = 0;
            Stack<Integer> stack = new Stack<>();
            for (int num : nums) {
                sub += num;
//                if()
                stack.push(num);
            }

            return false;

        }
    }
//leetcode submit region end(Prohibit modification and deletion)

}
